package com.naizhuai.ui.entity.mainbusiness;

import com.google.gson.Gson;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 提交的限制条件的基本结构
 * Created by code_han on 2018/4/16.
 */

public class LimitContent implements Serializable {

    public static final String ALL_CHOSEN = "1";
    public static final String CHOSEN_USER = "2";
    public static final String CHOSEN_DEPARTMENT = "3";
    public static final String CHOSEN_MIX = "4";

    //类型 1、全部，2、只有人，3、只有部门，4、混合
    private String limitType;
    //限定的人的id的数组的json
    private List<String> uidList;
    //限定的部门的数组的json
    private List<String> departmentList;

    public LimitContent() {
        uidList=new ArrayList<>();
        departmentList=new ArrayList<>();
    }

    public String getLimitType() {
        return limitType;
    }

    public void setLimitType(String limitType) {
        this.limitType = limitType;
    }

    public List<String> getUidList() {
        return uidList;
    }

    public void setUidList(List<String> uidList) {
        this.uidList = uidList;
    }

    public List<String> getDepartmentList() {
        return departmentList;
    }

    public void setDepartmentList(List<String> departmentList) {
        this.departmentList = departmentList;
    }

    public boolean memberEmpty(){
        return uidList.size()==0&&departmentList.size()==0;
    }

    @Override
    public String toString() {
        Gson son=new Gson();
        return son.toJson(this);
    }
}
